/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hl7.datatypes.r2.foundation;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.hl7.datatypes.r2.basic.ST;

/**
 *
 * @author Obama
 */
@Embeddable
public class TYPE extends ANY implements Serializable{
    @Column(name="SHORTNAME")
    private String shortName;
    
    @Column(name = "LONGNAME")
    private String longName;

    public ST shortName(){
        return new ST(shortName);
    }
    public ST longName(){
        return new ST(longName);
    }

    public BL implies(TYPE that) {
        //TODO
        return equal(that);
    }

    public BL isComparableTo(TYPE that) {
        //TODO
        return implies(that);
    }

    @Override
    public BL equal(ANY x) {
        return new BL(equals(x));
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 73 * hash + Objects.hashCode(this.shortName);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TYPE other = (TYPE) obj;
        if (!Objects.equals(this.shortName, other.shortName)) {
            return false;
        }
        return true;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getLongName() {
        return longName;
    }

    public void setLongName(String longName) {
        this.longName = longName;
    }
  
}
